1 #!/usr/bin/env python
2 #-*- coding: utf-8 -*-
3 import rospy
4 from std_msgs.msg import String
5 
6 def callback(data):   
7     rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
8
9 def listener():

14	rospy.init_node('listener', anonymous=True)
15	

18	rospy.Subscriber("chatter", String, callback)
19	rospy.spin()
20

21 if __name__ == '__main__':
22	listener()
